class AutodiscoverFeedViewlet(ViewletBase):

    template = ViewPageTemplateFile('autodiscover.pt')

    def render(self):
        if not getUtility(IFeedSettings).enabled
            return ''
        if config is None:
            return ''
        self.feed_view = config.format
        self.feed_name = config.name
        format_info =  getUtility(IFeedFormats).getFormatInfo(config.format)
        self.type = format_info['autodiscover_type']
        self.title = IFeed(self.context).title
        return template
